package com.by.controller;

import com.by.bean.ResultBean;
import com.by.bean.ScreenInquiry;
import com.by.group.V;
import com.by.service.ScreenInquiryService;
import com.by.utils.Assert;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :LYJ
 * @version : 1.0
 * @date : 2025/2/27 21:40
 * @desc : 筛网询价表
 * @since : JDK17
 */
@RestController
@RequestMapping("/api")
@Api(tags = "筛网询价表")
public class ScreenInquiryController extends BaseController {
    @Autowired
    ScreenInquiryService screenInquiryService;

    @PostMapping("/screenInquiry/save")
    @ApiOperation("筛网询价表保存信息")
    public ResultBean save(@Validated @RequestBody ScreenInquiry screenInquiry, BindingResult result) {
        V.validate(result);
        int res = screenInquiryService.save(screenInquiry);
        Assert.isZero(res, "添加失败");
        return success("success", screenInquiry);
    }
}
